package com.xigua._排序;

import java.util.Arrays;

/**
 * @author LiRongHua
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2022/3/2014:28
 */
public class _剑指Offer40_最小的k个数 {


    public int[] getLeastNumbers(int[] arr, int k) {
        Arrays.sort(arr);
        int ans[] = new int[k];
        System.arraycopy(arr,0,ans,0,k);
        return ans;
    }
}
